package com.base.cn.platform.os.controller.web.qa.add;

import com.base.cn.platform.os.common.WebBaseController;
import com.base.cn.platform.os.service.course.qa.qaadd.QaAddService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Map;

/**
 * PC端问题追问Controller
 *
 * @author LIZHIPENG
 * @create 2018-05-29 上午 10:25
 */
@Controller
@RequestMapping("/web/uc/qa/add")
public class WebQaAddController extends WebBaseController {

    @Autowired
    private QaAddService qaAddService;

    /**
     * PC端保存问题追问
     * @param request HttpServletRequest
     * @param params 追问信息
     * @return Map<String, Object>
     */
    @RequestMapping("/saveQuestionAdd")
    @ResponseBody
    public Map<String, Object> saveQuestionAdd(HttpServletRequest request,
                                               @RequestBody Map<String, Object> params){
        BigDecimal userId = webMobileLoginUtil.getLoginUserId(request);
        return qaAddService.saveQuestionAdd(params, userId);
    }

}
